package com.rm.zeyou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rm.zeyou.entity.TechnicianConsumeDetail;
import com.rm.zeyou.vo.response.OrderList;
import com.rm.zeyou.vo.response.RevenueDetailsList;
import com.rm.zeyou.vo.response.RevenueDetailsOrderList;
import com.rm.zeyou.vo.response.TechnicianPersonalCenterResponseVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 技师收入/支出表 Mapper 接口
 * </p>
 *
 * @author YanYang
 * @since 2025-03-12 15:55:09
 */
@Mapper
public interface TechnicianConsumeDetailMapper extends BaseMapper<TechnicianConsumeDetail> {

    /**
     * type = 1=今天 2=昨天
     * @Date 2025 3月 18 09:55
     * @param tid
     * @param type
     * @return
     */
    TechnicianPersonalCenterResponseVo selectAmountById(@Param("tid") Long tid, @Param("type") Integer type);
    TechnicianPersonalCenterResponseVo selectTotalAmount(@Param("tid") Long tid);


    BigDecimal selectAddAmount(@Param("tid")Long tid,@Param("priceStatus")Integer priceStatus);

    BigDecimal selectPayoutAmount(@Param("tid")Long tid);

    Integer selectOrderVolume(@Param("tid")Long tid);

    List<OrderList> selectOrderList(@Param("tid")Long tid, @Param("subType")Integer subType);

    RevenueDetailsList selectDetailsList(@Param("tid")Long tid, @Param("subType")Integer subType);

    List<RevenueDetailsOrderList> selectRevenueDetailsOrderList(@Param("tid")Long tid, @Param("subType")Integer subType);


    @Delete("delete from t_technician_consume_detail where order_no  =#{orderNo} ")
    Integer deleteByOrderNo(@Param("orderNo") String orderNo);
}
